package com.example.demo.util;

import com.example.demo.entity.User;
import com.example.demo.vo.UserVO;
import org.springframework.beans.BeanUtils;

/**
 * 用户转换工具类
 * 
 * @author zhang
 * @date 2024
 */
public class UserConverter {
    
    /**
     * 将User转换为UserVO
     */
    public static UserVO toVO(User user) {
        if (user == null) {
            return null;
        }
        UserVO vo = new UserVO();
        BeanUtils.copyProperties(user, vo);
        return vo;
    }
}

